# coding: utf8
# datetime: 2021-04-18
# 题目地址: https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/

from typing import List

class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        i = 1
        for num in nums:
            if num != nums[i-1]:
                nums[i] = num
                i += 1
        return i

a = Solution()
print(a.removeDuplicates([1,1,2]))
